import {
	http
} from '@/utils/request/index.js'
// CRM 回款管理相关接口

// 查询回款列表
export function getReceivablePage(params) {
	return http.get('/crm/receivable/page', params)
}

// 查询回款列表
export function getReceivablePageByCustomer(params) {
	return http.get('/crm/receivable/page-by-customer', params)
}

// 查询回款详情
export function getReceivable(id) {
	return http.get('/crm/receivable/get', { id })
}

// 新增回款
export function createReceivable(data) {
	return http.post('/crm/receivable/create', data)
}

// 修改回款
export function updateReceivable(data) {
	return http.put('/crm/receivable/update', data)
}

// 删除回款
export function deleteReceivable(id) {
	return http.delete('/crm/receivable/delete', { id })
}

// 导出回款 Excel
export function exportReceivable(params) {
	return http.download('/crm/receivable/export-excel', params)
}

// 提交审核
export function submitReceivable(id) {
	return http.put('/crm/receivable/submit', { id })
}

// 获得待审核回款数量
export function getAuditReceivableCount() {
	return http.get('/crm/receivable/audit-count')
}
